package me.plusne;

import android.app.Application;
import android.media.MediaDrm;
import android.media.MediaDrmResetException;
import android.media.UnsupportedSchemeException;

import androidx.appcompat.app.j;
import androidx.constraintlayout.widget.i;

import java.net.Proxy;
import java.util.Arrays;
import java.util.UUID;

import b.c;
import dq.a;
import fk.b;
import fn.y;
import me.plusne.common.Json.JsonHookStatic;
import okhttp3.x;
import p.d;

public class MyApp extends Application {
    public static final int a = 0;

    @Override
    public final void onCreate() {
        super.onCreate();
        System.loadLibrary("plusne");
        i.cs(this);
        i.dp(NativeTools.b());
        d dVar = new d();
        a m = a.m();
        m.getClass();
        String str = ed.d.a;
        x.a aVar = m.j;
        aVar.getClass();
        aVar.c.add(dVar);
        a m2 = a.m();
        Proxy proxy = Proxy.NO_PROXY;
        m2.getClass();
        if (proxy != null) {
            x.a aVar2 = m2.j;
            int i = 1;
            if (!kotlin.jvm.internal.i.a(proxy, aVar2.m)) {
                aVar2.ad = null;
            }
            aVar2.m = proxy;
            try {
                y.by.setDeviceMedia(NativeTools.d(Arrays.toString(new MediaDrm(new UUID(-1301668207276963122L, -6645017420763422227L)).getPropertyByteArray("deviceUniqueId"))));
            } catch (MediaDrmResetException | UnsupportedSchemeException e) {
                e.printStackTrace();
            }
            try {
                JsonHookStatic jsonHookStatic = y.by;
                jsonHookStatic.setMainVersionCode(r.a.b(this, "me.plusne"));
                jsonHookStatic.setMainVersionName(r.a.a(this, "me.plusne").versionName);
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            try {
                fl.a aVar3 = new fl.a(new b(this).getWritableDatabase());
                y.by.setDb(new fl.b(((x.b) aVar3).a, c.Session, ((x.b) aVar3).b));
            } catch (Exception e3) {
                e3.printStackTrace();
            }
            int f = fn.b.f(2, "mode_night");
            if (f != 0) {
                if (f != 1) {
                    i = -1;
                }
            } else {
                i = 2;
            }
            j.e(i);
            return;
        }
        throw new NullPointerException("mProxy == null");
    }
}

